home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3882 < prev    next >
Encoding:
Text File  |  1996-08-05  |  49.2 KB  |  1,191 lines

  1. Path: informatik.tu-muenchen.de!kellerer
  2. From: kellerer@informatik.tu-muenchen.de (Ignaz Kellerer)
  3. Newsgroups: comp.sys.amiga.introduction,comp.sys.amiga.misc,comp.sys.amiga.programmer,comp.answers,news.answers
  4. Subject: Amiga FAQ (Frequently asked questions) (Part 2 of 4)
  5. Supersedes: <AmigaFAQ-2-819392424@informatik.tu-muenchen.de>
  6. Followup-To: comp.sys.amiga.introduction
  7. Date: 13 Feb 1996 17:00:25 GMT
  8. Organization: InternetNews at TUM, Technical University of Munich, Germany
  9. Approved: news-answers-request@MIT.EDU
  10. Distribution: world
  11. Expires: Sunday, 17 Mar 96 18:00:21 MESZ
  12. Message-ID: <AmigaFAQ-2-824230821@informatik.tu-muenchen.de>
  13. References: <AmigaFAQ-1-824230821@informatik.tu-muenchen.de>
  14. Reply-To: kellerer@informatik.tu-muenchen.de (Ignaz Kellerer)
  15. NNTP-Posting-Host: hphalle9c.informatik.tu-muenchen.de
  16. Content-Type: text/plain; charset=ISO-8859-1
  17. Content-Transfer-Encoding: 8bit
  18. Summary: Frequently asked questions on the Amiga.
  19.          New users should read this!
  20. Originator: kellerer@hphalle9c.informatik.tu-muenchen.de
  21.  
  22. Posted-By: auto-faq 2.4
  23. Archive-name: amiga/introduction/part2
  24. Last-modified: Tuesday, 13. January 1996
  25. Posting-Frequency: ever fourth week
  26.  
  27.  
  28.     Frequently asked questions (FAQ) concerning the Amiga. [2/4]
  29.     ------------------------------------------------------------
  30.  
  31. This is the second part of the Amiga-FAQ. It is in Ascii format to be
  32. easily read by everyone. It is also available in AmigaGuide, Dvi and
  33. html (for WWW servers) format as part of the Amiga-FAQ archive.
  34. (File docs/misc/AmigaFAQ.lha on any Aminet site)
  35.  
  36. Please note the following:
  37.  
  38.   - Changes since the last posting are marked with a
  39.     !    changed this line/section, respectively
  40.     +    added this line
  41.     <    removed something before this line
  42.  
  43.   - An index is at the bottom of this part. If this still doesn't help:
  44.     E-mail me, probably I can include an answer into the FAQ.
  45.  
  46.   - Suggestions, contributions, critics and beer bottles are very
  47.     welcome. :-) Send them to:
  48.  
  49.         Ignaz Kellerer
  50.         Georg-Habel-Str. 11
  51.       81241 Muenchen (Germany)
  52.         Tel. (+49) 089 / 885147
  53.  
  54.         Internet: kellerer@informatik.tu-muenchen.de
  55.  
  56. ===========================(Cut here)=========================================
  57.  
  58.  
  59.   Disclaimer
  60.  
  61.   1 CPU, Custom chips, RAM and other stuff
  62.     1 What are 68EC020, 68EC030 and 68LC040?
  63.     2 What's an FPU?
  64.     3 Can I use a 3.5' HD in my A1200?
  65.  
  66.   2 The Operating System
  67.     1 Can I use another Kickstart than the builtin?
  68.     2 The Graphical User Interface
  69.     3 What is MUI?
  70.       1 Icon collections and Backgrounds
  71.     4 What is the Amiga equivalent of . (Current directory)?
  72.     5 The PIPE: queue-handler
  73.       1 Using PIPE: in a standard AmigaShell environment
  74.       2 The Pipe command
  75.       3 Pipe command support in AmigaShell
  76.       4 Quick usage guide
  77.       5 Related things
  78.       6 Troubleshooting
  79.     6 ARexx, the program control language
  80.  
  81.   3 How about Graphics?
  82.     1 What are chunky and planar displays?
  83.     2 What is doublebuffering?
  84.     3 What monitors will work on my Amiga 1200/4000?
  85.     4 How do I switch between PAL and NTSC?
  86.  
  87.   4 Programming
  88.     1 What documentation do I need as an Amiga programmer?
  89.     2 What is CATS?
  90.     3 Where do I get the Amiga includes?
  91.     4 How do I become a developer?
  92.     5 What compilers (assemblers) are there?
  93.     6 Those never working Esc sequences!
  94.     7 Is it possible to use AmigaBasic on the A1200?
  95.     8 How do I localize my program?
  96.     9 How to obtain a pointer to a console's window
  97.     10 What are pragmas?
  98.     11 My Compiler/Linker is complaining about missing symbol xxx.
  99.     12 Where do I find the function xxx?
  100.     13 The GNU C compiler: general information and installation
  101.       1 Current Version
  102.       2 Requirements
  103.       3 Authors
  104.       4 Sources for Gcc
  105.       5 Inline Headers
  106.       6 Amiga Libraries
  107.       7 Installation
  108.       8 Compiling
  109.       9 How to get help
  110.  
  111.   5 Applications
  112.     1 Text Editors
  113.     2 What word processors are there?
  114.     3 Desktop Publishing
  115.     4 What is TeX and where can I get it?
  116.     5 Are there any Postscript interpreters?
  117.       1 Amiga Font Formats
  118.       2 Frequently Requested Amiga Fonts
  119.       3 Commercial Font Sources
  120.       4 Non-Latin fonts on the Amiga
  121.       5 Amiga Font Installation
  122.       6 Amiga Font Utilities
  123.       7 Making Outline Fonts
  124.       8 Problems and Possible Solutions
  125.     6 How to deal with Non-Latin texts?
  126.       1 Japanese editors and viewers
  127.       2 Chinese text viewers
  128.  
  129.   6 Connecting your Amiga to the world
  130.  
  131.   7 Emulators
  132.     1 Can I run Unix on my Amiga?
  133.     2 Is it possible to use the Amiga as X11 terminal?
  134.     3 Is there a way to start MS-Dos programs?
  135.     4 How to mount MsDos-formatted Syquests on Amiga
  136.  
  137.   8 Miscellaneous
  138.     1 Is there any unix version of LhA?
  139.     2 What are files ending with ...?
  140.     3 Is there a Stacker-like utility to pack my hard drive?
  141.     4 Where do I get Fish disk xxx?
  142.  
  143.   9 Where and how do I get software and other informations?
  144.     1 Files and databases on freely distributable software
  145.     2 A collection of tests
  146.     3 Getting files from a FTP server
  147.     4 Getting files from a Mail server
  148.     5 Getting files from a mailbox
  149.     6 The Fish PD series
  150.       1 The Amiga Library disks
  151.       2 The Fresh Fish CD-Roms
  152.     7 How do I Read and write MS-Dos disks?
  153.     8 How do I split large files?
  154.     9 Discussing things
  155.     10 Other FAQ's
  156.  
  157.   The Amiga-FAQ archive
  158.  
  159.   Contributions
  160.  
  161.   Credits
  162.  
  163.   Index
  164.  
  165.  
  166.  
  167.   4 Programming
  168.   *************
  169.   
  170.      This chapter handles problems arising for programmers and
  171.   compiler-users only.
  172.   
  173.   4.1 What documentation do I need as an Amiga programmer?
  174.   ========================================================
  175.   
  176.      The best information available are the RKMs (ROM Kernel Manuals), 3rd
  177.   edition, by Commodore, published by Addison-Wesley:
  178.        The Amiga ROM Kernel Manual:  Libraries, ISBN 0-201-56774-1
  179.        The Amiga ROM Kernel Manual:  Devices, ISBN 0-201-56775-X
  180.        The Amiga ROM Kernel Manual:  Includes and Autodocs, ISBN
  181.                                                             0-201-56773-3
  182.        The Amiga Hardware Manual, ISBN 0-201-56776-8
  183.        The Amiga User Interface Style Guide, ISBN 0-201-57757-7
  184.   
  185.   Especially the RKM: Libraries is a must. The RKM: Includes and Autodocs
  186.   isn't that much worth: Better get the same stuff on disk instead to
  187.   have it online.  See Includes.
  188.   
  189.      AmigaDOS isn't included in these books. The Autodocs give much
  190.   information, but to go deeper you probably need
  191.        The AmigaDOS Manual, 3rd Edition, ISBN 0-553-35403-5
  192.      published by Bantam Books.
  193.   
  194.      A better choice for developers is
  195.        The Amiga Guru Book
  196.   
  197.   by Ralph Babel. The book starts with a survey on different aspects of
  198.   programming the Amiga. (About 250 pages) Useful for beginners are the
  199.   sections on the Amiga's data types (not to be confused with the 3.x
  200.   DataTypes used by MultiView, for example), the Includes and the
  201.   amiga.lib. But even experienced programmers will find useful things
  202.   here that are missing in the RKMs.  But the largest part are about 500
  203.   pages on AmigaDOS and, as I think, the most important, because AmigaDOS
  204.   is the worst officially documented part of the OS. The book is rather
  205.   concise and hence not as easy to read as the RKMs, but I recommend it
  206.   as an addition and instead of the AmigaDOS manual.  (Not, however, a
  207.   replacement for the Libraries and Devices, which aren't covered here.)
  208.   Unfortunately the book has no ISBN and is available in special stores
  209.   only. But there are some mail order companies which offer it for about
  210.   50$ and which accept credit cards:
  211.   
  212.                                    Almathera Systems Limited
  213.                                    Southerton House
  214.        NBG USA, Inc.               Boundary Business Court
  215.        482 Holly Avenue            92-94 Church Road
  216.        St. Paul, MN 55102          Mitcham, Surrey CR4 3TD
  217.        USA                         England
  218.        Voice: +1 (612) 290 9447    Voice: +44 181 687 0040
  219.        Fax:   +1 (612) 290 9449    Fax:   +44 181 687 0490
  220.                                    E-Mail: <almathera@cix.compulink.co.uk>
  221.        
  222.                                    Stefan Ossowskis Schatztruhe
  223.        Hirsch & Wolf OHG           Gesellschaft fⁿr Software mbH
  224.        Mittelstra▀e 33             Veronikastra▀e 33
  225.        D-56564 Neuwied             D-45131 Essen
  226.        Germany                     Germany
  227.        Voice: +49 (2631) 8399-0    Voice: +49 (201) 788778
  228.        Fax:   +49 (2631) 8399-31   Fax:   +49 (201) 798447
  229.                                    E-Mail: <stefano@tchest.e.eunet.de>
  230.        
  231.        Someware
  232.        27 rue Gabriel PΘri
  233.        59186 Anor
  234.        France
  235.        Voice: +33 27596000
  236.        Fax:   +33 27595206
  237.        E-Mail: <didierj@swad.someware.com>
  238.      See FAQs.
  239.   
  240.   4.2 What is CATS?
  241.   =================
  242.   
  243.      This is a department at Commodore West Chester which was formerly
  244.   named `Commodore Amiga Technical Support' and was later renamed
  245.   `Commodore Application and Technical Support'. These are people that
  246.   work independently of Engineering, but close together with them, and try
  247.   to help developers outside of Commodore to create nice Amiga
  248.   applications, software or hardware. To achieve this, CATS has gathered
  249.   a lot of informations and tools, on floppy, CD, or paper. Much of this
  250.   material is also available to the general public. (1) But don't mix
  251.   this up with some sort of Hotline for everyone!
  252.   
  253.      For Americans the address to get this material is
  254.            CATS
  255.            Commodore Electronics Limited
  256.            950 Rittenhouse Road
  257.            Norristown, PA 19403
  258.   
  259.   for all Europeans it's a company in Germany:
  260.            Fa. Hirsch & Wolf
  261.            Mittelstr. 33
  262.            56564 Neuwied
  263.            Tel. 02631/83990
  264.   
  265.      Dr. Peter Kittel, peterk@cbmger.de.so.commodore.com
  266.   
  267.      ---------- Footnotes ----------
  268.   
  269.      (1)  Which means: For Non-Developers.
  270.   
  271.   4.3 Where do I get the Amiga includes?
  272.   ======================================
  273.   
  274.      The only legal way to get the includes and autodocs (and you *should*
  275.   get them, they are *very* useful!) is to become a developer (see
  276.   Developer) or to buy the `NDU' (Native developers update kit, also
  277.   known as `NDUK' or `NDK'), which is offered by CATS. They cost about
  278.   30$ plus shipping and this seems to me to be a fair price. See CATS.
  279.   The current version is 3.1.
  280.   
  281.      If you need only the includes, you could get them as well with a
  282.   compiler (commercial compilers only) or by getting the Fresh Fish CD.
  283.   See Fish CD.
  284.   
  285.   4.4 How do I become a developer?
  286.   ================================
  287.   
  288.      You need the `ADSP' (Amiga Developer Support Program) documents. To
  289.   get this write a letter to your local Commodore branch asking for these
  290.   documents.  Everything else should be explained there. The german
  291.   address (for the US address see CATS) is
  292.            Commodore
  293.            Lyoner Strasse 38
  294.            60528 Frankfurt
  295.      There are three different developer versions:
  296.   *Registered*
  297.        developers get access to the CBMNET (kind of a Commodore-internal
  298.        Usenet), which makes it possible to discuss problems with other
  299.        developers, Commodore engineers included. Registered developers
  300.        pay about US$80 per year, plus initial US$30 initially.
  301.   
  302.   *Certified*
  303.        developers seem to me the most interesting claass: They have the
  304.        possibility copy the most beta versions of the system software
  305.        (Kickstart and Workbench) and the respective Includes and
  306.        AutoDocs. (Not all beta versions and especially no beta hardware.)
  307.        You pay about US$250 per year plus US$50 initially for this.
  308.   
  309.   *Commercial*
  310.        developers finally have in most details the same as certified
  311.        developers, but may expect to get more beta versions and sooner,
  312.        included beta hardware (This has *not* always been so in the
  313.        past.), hencethey pay about US$400 plus US$50 initially.
  314.   
  315.   The above describes the prices and the situation in Germany and might be
  316.   different elsewhere. Especially not all Commodore branches offer the
  317.   registered status. A hint is to build a group of users and become a
  318.   developer group, so the costs are reduced.
  319.   
  320.      All developers have to sign non-disclosure agreements (`NDA') which
  321.   specify that we may not discuss information outside of authorized areas
  322.   even to other developers until given explicit permission by Commodore.
  323.   
  324.   4.5 What compilers (assemblers) are there?
  325.   ==========================================
  326.   
  327.      There is a lot of programming languages on the Amiga, commercial as
  328.   well as freely distributable. I will enumerate only those that I know
  329.   or which seem it worth to me otherwise.
  330.   
  331.   *Assembler*
  332.        All C-compilers have an Assembler included. Freely distributable
  333.        are A68K and PhxAss (directory `dev/asm' on Aminet or Fish disks
  334.        521 and 906)
  335.   
  336.        Commercial Assemblers are MaxonASM, OMA3.0 and DevPack3.14.
  337.   
  338.   *Basic*
  339.        The following commercial Basic-compiler/interpreter are available:
  340.        BlitzBasic2, Amos and MaxonBasic3.
  341.   
  342.   *C*
  343.   *C++*
  344.        Freely distributable C-compilers are `gcc' (which has its own
  345.        directory `dev/gcc' on Aminet) and the evaluation version of
  346.        `Dice' (for example per FTP from `ftp.uni-paderborn.de', directory
  347.        `/news/comp.binaries.amiga/volume91/languages' or on Fish disk
  348.        491).  The advantage of gcc is that you find gcc versions all over
  349.        the world and on all computer systems. Another advantage is that
  350.        C++ is included into gcc! But it is slow and needs 4Mb of RAM or
  351.        more.  See The GNU C compiler.  See Mailing lists.
  352.   
  353.        Commercial C compilers are `Aztec-C', `Dice', `SAS/C' amd
  354.        `MaxonC++'.  `Aztec-C' doesn't seem to get further development any
  355.        more.  It should be remarked that the commercial compilers have
  356.        especially wonderful debugging utilities (Source level debuggers!)
  357.        that the others are missing.
  358.   
  359.        SAS has announced to drop support of the Amiga-Compiler, too, due
  360.        to the Amiga's bad situation. However, the compiler is still
  361.        available and up-to-date and has a crosscompiler included, which
  362.        translates C++ to C and supports the source level debugger too.
  363.        Considering the price of just 99$ for students and updates from
  364.        recent versions or other compilers it is still the most
  365.        recommendable of the three. In europe the compiler is available
  366.        from
  367.                 SAS Institute, Inc.           SAS Institute Gmbh
  368.                 Book Sales                    PO Box 10 53 40
  369.                 SAS Campus Drive              69043 Heidelberg
  370.                 Cary, NC 27513                Germany
  371.                 USA
  372.             
  373.                 Phone: (919)677-8000          Phone: (49)6221-4160
  374.                 EMail: sasdsb@vm.sas.com      EMail: eurdoc2@vm.sas.com
  375.   
  376.        Dice is the cheapest and fastest commercial compiler. The greatest
  377.        disadvantage of Dice (compared to the other commercial compilers)
  378.        is the so-called Source-Line-Debugger: This means that you see the
  379.        current line of source and can execute the program step by step,
  380.        like with the other debuggers. On the other hand you can examine
  381.        memory only, not the variables.  To get information about DICE,
  382.        send email to info@oic.COM. An automatic system will return
  383.        complete details, including upgrade prices.
  384.   
  385.        Comeau C++ is a crosscompiler like SAS/C++. That wouldn't be a
  386.        problem, but Comeau C++ doesn't have a C compiler included.  You
  387.        need SAS/C, Aztec-C or Dice additionally. But it is AT&T cfront 3.0
  388.        compliant and supports exceptions. And like gcc it runs on many
  389.        platforms.  Maxxon C++ is offered in Germany. I cannot say
  390.        anything on it. Both compilers are commercial. Comeau's address is:
  391.                 Comeau computing
  392.                 91-34, 120th Street
  393.                 Richmond Hill, NY, 11418-3214
  394.                 USA
  395.             
  396.                 EMail: Greg Comeau, comeau@bix.com
  397.   
  398.        Maxon C++ is both a C++ and a C compiler. There is a light version
  399.        and a developer version. The developer version matches the AT&T
  400.        standard 3.0.  Maxon-light includes a compiler and a editor.
  401.        Developer includes a source level debugger, Amiga classes library
  402.        and Hot Help with documentation to the amiga libs.  It is a german
  403.        product, and compiler and documentation are german.  The compiler
  404.        has some little bugs, but you can work with it well, anyway.
  405.   
  406.   *Forth*
  407.        JForth is said to be an excellent Amiga port of Forth. Among its
  408.        advantages are object oriented extensions, full Amiga interface
  409.        and an application generator. It is available from:
  410.                 Delta Research
  411.                 P.O. Box 151051
  412.                 San Rafael, CA   94915-1051
  413.             
  414.                 Phone: (415) 453-4320
  415.                 EMail: Phil Burk, phil@ntg.com
  416.                        Mike Haas, haas@starnine.com
  417.   
  418.   *Fortran*
  419.        (Sigh! Still people who need it :-<) Freely distributable are BCF
  420.        (Fish disk 470) and f2c, a Fortran to C converter (Aminet,
  421.        directory `/dev/lang'). A commercial compiler is offered from
  422.        ABSoft. All these are Fortran 77 compilers, I don't know any
  423.        Fortran 90 compiler on the Amiga.
  424.   
  425.   *Lisp*
  426.        Freely distributable Lisp interpreters are XLisp (Fish disk 181)
  427.        and OakLisp (Fish disks 519 and 520) and CLISP
  428.        (`/pub/lisp/clisp/binaries/amiga' at the server `ftp
  429.        ma2s2.mathematik.uni-karlsruhe.de'). Lisp compilers are Gambit
  430.        (Fish 764 and 765) and Scheme-to-C (Fish disks 556, 557 and 558).
  431.        See Mailing lists.
  432.   
  433.   *Prolog*
  434.        `/dev/lang/UNSWProlog.lha' and `dev/lang/sbp3_1e.lha' on Aminet as
  435.        well as `SBProlog' on Fish disk 141 and `SBProlog' on Fish disk
  436.        145 are freely distributable Prolog interpreters.
  437.   
  438.   *Modula-2*
  439.        M2Amiga is offered in Europe, Benchmark Modula-2 in the U.S. Both
  440.        are said to be very good, have a powerful source-level-debugger, a
  441.        large library.  Especially M2Amiga has great support by a german
  442.        user-group (AMOK) which for example offers own PD disks. See
  443.        Mailing lists.
  444.   
  445.        M2Amiga is offered by:
  446.                 A+L AG
  447.                 Daderiz 61
  448.                 2540 Grenchen
  449.                 Schweiz
  450.             
  451.                 Tel.: +41/65/52 03-11
  452.                 Fax:              -79
  453.   
  454.        Benchmark Modula-2 is available from:
  455.                 Armadillo Computing
  456.                 5225 Marymount Drive
  457.                 Austin, Texas 78723
  458.                 USA
  459.             
  460.                 Phone/FAX: 512/926-0360.
  461.                 EMail: Jim Olinger, jolinger@bix.com
  462.   
  463.   *Oberon*
  464.   *Oberon-2*
  465.        Two compilers (both Oberon-2) are available: AmigaOberon
  466.        (commercial) is offered by the same company as M2Amiga. It is
  467.        integrated into a full developers environment and has a large
  468.        library of modules.  Library linker and  source level debugger are
  469.        available.
  470.   
  471.        Oberon-A is a Freeware compiler. (Source: Aminet, `dev/obero'
  472.        directory) However, this is a beta release, especially the module
  473.        library is limited. See Mailing lists.
  474.   
  475.        The AMOK user group supports AmiOberon as well as M2Amiga.
  476.   
  477.        In addition to these two standalone compilers which are thought
  478.        mainly for creating AmigaOS applications, there is an Amiga port of
  479.        the Oberon Sytem V4, too. The Oberon System is implemented as an
  480.        AmigaOS-Task using a separate screen and includes an Oberon-2
  481.        compiler. You can use it to write software that will work on all
  482.        implementations of the Oberon System V4 (for example Macintosh,
  483.        Windows or Sparc) without any changes.
  484.   
  485.   *Pascal*
  486.        There is a PD-compiler called PCQ (Directory `dev/lang' on Aminet
  487.        or Fish disk 511). It doesn't support all of Pascal and major
  488.        features are missing. P2C, a pascal to C converter is on disk 341.
  489.        (Aminet: `/dev/misc/p2c120.lha') Additionally there are two
  490.        commercial compilers called HiSoft Pascal and KickPascal. HiSoft
  491.        Pascal and P2C claim to be compatible to Turbo Pascal up to 5.0.
  492.        HiSoft has a source level debugger included.
  493.   
  494.   4.6 Those never working Esc sequences!
  495.   ======================================
  496.   
  497.      Many printers come with a manual that explains which Esc sequence
  498.   causes which action on the printer. But there happen weird things when
  499.   you try to send these sequences to your printer, either it does
  500.   nothing, or it does something completely different. There is a reason,
  501.   the Amiga printer drivers. These drivers are made in a way that they
  502.   only understand a certain set of `ANSI Esc sequences', not the special
  503.   ones defined (differently) by the various printer manufacturers. The
  504.   purpose is that every application on the Amiga just uses this one
  505.   standard set of control sequences and this way doesn't need to know
  506.   which printer is actually connected. The printer driver then translates
  507.   these standard sequences into the special sequences a certain printer
  508.   understands.  A list of the available ANSI Esc sequences is found in
  509.   the current Workbench manuals (or older AmigaDOS manuals). Now if you
  510.   want to issue a control sequence to the printer that's not available as
  511.   an ANSI command, you have two possibilities to achieve this:
  512.     1. Bypass the printer driver (that would unsuccessfully try to
  513.        interpret the sequence) and send your output *only* during this
  514.        sequence to `PAR:' (or `SER:', respectively). For this you have to
  515.        close and open printer output channels very often which is rather
  516.        tedious, and you have to know where (`PAR:' or `SER:') your
  517.        printer is connected.
  518.   
  519.     2. Use a special ANSI sequence, made exactly for this case:
  520.                 `Esc[<n>"<x>'
  521.        where `<n>' is the decimally typed number of bytes in the string
  522.        `<x>', which actually contains your special printer sequence. This
  523.        ANSI sequence tells the printer driver to not interpret or
  524.        translate the next `<n>' bytes.
  525.           But both methods have one big disadvantage when used in an
  526.   application program: You lose the printer independency! If you stick to
  527.   ANSI sequen- ces, you can output to any printer on earth, as long as
  528.   there is an Amiga printer driver for it. If you start to use special
  529.   control sequences, your program will be tied to this single printer
  530.   model and will not be usefull for any other (or you would have to
  531.   provide some dozen new printer drivers for your application).
  532.   
  533.      Dr. Peter Kittel, peterk@cbmger.de.so.commodore.com
  534.   
  535.   4.7 Is it possible to use AmigaBasic on the A1200?
  536.   ==================================================
  537.   
  538.      AmigaBasic wurde (als einziges Amiga-Programm) von Microsoft
  539.   entwickelt und ist entsprechend fehlerhaft.
  540.   
  541.      Man kann es auf dem A1200 trotzdem zum Laufen bringen, wenn man
  542.   folgendes beachtet:
  543.   
  544.     1. run NoFastMem (or turn off FastMem).
  545.   
  546.     2. Switch off sound output in the Sound prefs editor.
  547.   
  548.     3. Better avoid SUBs and use GOSUBs instead, then the compatibility
  549.        with newer processors will be higher.
  550.   
  551.     4. There is a patch you should run at the beginning of AmigaBasic:
  552.               ---------------------------------- CUT HERE -------------------------------
  553.                `" AmigaBASIC patch to let AmigaBASIC work on A1200 and other newer machines.
  554.                `" Start at the beginning of AmigaBASIC or invoke AmigaBASIC with this program
  555.             
  556.                OPEN "AMIGABasic" AS 1 LEN=1
  557.                FIELD #1,1 AS d$
  558.                i&=&HF3*256+&H87 : PRINT i&
  559.                GET #1,i& : a$=HEX$(ASC(d$))
  560.                PRINT a$
  561.                IF a$="79" THEN
  562.                    LSET d$=CHR$(&H78)
  563.                    PUT #1,i&
  564.                END IF
  565.                CLOSE 1
  566.               ---------------------------------- CUT HERE -------------------------------
  567.   
  568.      Andreas Mixich, humpty@tomate.tng.oche.de
  569.   
  570.   4.8 How do I localize my program?
  571.   =================================
  572.   
  573.      Suggest, you want to write a `HelloLocalWorld.c'. Your final program
  574.   will look like this:
  575.   
  576.            #include "HelloLocalWorld_Cat.h"
  577.            #include <clib/exec_protos.h>
  578.        
  579.            struct Library *LocaleBase;
  580.        
  581.            void main(int argc, char *argv[])
  582.        
  583.            {
  584.                /* Open the locale.library. No kill, if not successfull.
  585.                   (Just use the builtin catalog strings instead.) Note, that
  586.                   we open locale.library here, even if our compiler supports
  587.                   AutoOpening.
  588.                */
  589.                LocaleBase = OpenLibrary("locale.library", 38);
  590.                OpenHelloLocalWorldCatalogs(NULL, NULL);
  591.        
  592.                printf(GetString(MSG_Hello));
  593.        
  594.                CloseHelloLocalWorldCatalog();
  595.                if (LocaleBase) CloseLibrary(LocaleBase);
  596.            }
  597.   
  598.      The routine GetString checks, if the wished catalogs are available
  599.   and returns a pointer to either the builtin string or the catalog
  600.   string. (In my case the german string.)
  601.   
  602.      You see, the main difference besides the minor opening and closing
  603.   stuff (OpenLibrary, OpenHelloLocalWorldCatalogs, ...) (which too can be
  604.   dropped, too, with FlexCat) is to replace strings with a function call.
  605.   Hence we need a file `HelloLocalWorld_Cat.c', which holds
  606.   OpenHelloLocalWorld, GetString, CloseHelloLocalWorld and the builtin
  607.   strings (this could be an array, where
  608.                array[MSG_Hello] = "Hello, local world.\n";
  609.   
  610.   is defined) and an include file `HelloLocalWorld_Cat.h', which defines
  611.   the message ID's like MSG_Hello. You don't need to know, how these files
  612.   work internally, especially you don't need to know `locale.library'!
  613.   
  614.      There are some catalog generators (in what follows: CGs) available
  615.   (`CatComp', for devlopers only, `KitCat', german docs only, `MakeCat',
  616.   which I don't know and `FlexCat', which I  recommend, because it is
  617.   most flexible in the generated source and supports catalogs on 2.0 and
  618.   any language, even Amiga-E, Cluster, Pascal, ... and besides that: I'm
  619.   the author ;-) are tools, that create  HelloLocalWorld_Cat.h,
  620.   HelloLocalWorld_Cat.c and the real catalogs for you. (The above code
  621.   might differ slightly between the different CGs.) (See Aminet, directory
  622.   `dev/misc'.)
  623.   
  624.      Of course they need to know how to use them. First create a so-called
  625.   `catalog-description' file. This could look like this:
  626.            ; Lines beginning with a semicolon are comment lines.
  627.            # language english
  628.            ; the language of the builtin strings
  629.            # version 0
  630.            ; the catalog version (0 = any)
  631.            MSG_Hello (1/15/30)
  632.            Hello, local world
  633.   
  634.   Any string is defined by a line like the last two lines above: MSG_Hello
  635.   is the message-ID, (1/15/30) says, that the value of MSG_Hello should be
  636.   1 (you may omit this, in which case just the next free number is used)
  637.   and the string must not be shorter than 15 characters or longer than 30
  638.   characters. (These may be omitted too.)
  639.   
  640.      Now write your program. Once you are ready, use the CGs to create a
  641.   so-called catalog translation file. (One for any language different than
  642.   the builtin.) In my case (german) this could look like this:
  643.            ; Lines beginning with a semicolon are comment lines.
  644.            ## language deutsch
  645.            ; the catalog language (german)
  646.            ## version $VER: Deutsch.catalog 1.0 (22.12.93)
  647.            ; the catalog files version string
  648.            MSG_Hello
  649.        
  650.            ; Hello, local world
  651.   
  652.   Note the empty line after the message ID. (The arguments of ## language
  653.   and ## version would be missing as well.) You have to fill in the
  654.   german strings here. Again using the CGs you create a catalog file from
  655.   this. Additionally note, that no informations on the strings ID or
  656.   length are behind MSG_Hello.  They are taken from the catalog
  657.   description file.
  658.   
  659.      Once you change the program (adding strings, changing the string
  660.   length) you change the catalog description as well, use the CGs in the
  661.   same way to update the catalog translation and hence the catalogs.
  662.   
  663.   4.9 How to obtain a pointer to a console's window
  664.   =================================================
  665.   
  666.      The following function returns the window pointer of a CON window.
  667.   It can be executed safely under all versions of the Amiga's OS.
  668.   
  669.          struct Window *getConWindowPtr(BPTR fh)
  670.          {
  671.            struct Window *w;
  672.            struct FileHandle *cfh;
  673.            struct StandardPacket *sp;
  674.            struct InfoData *id;
  675.            struct MsgPort *mp;
  676.        
  677.            w = NULL;
  678.        
  679.            if ((cfh = BADDR(fh))->fh_Type != NULL) {
  680.              if (sp = AllocMem(sizeof (struct StandardPacket),
  681.                                MEMF_PUBLIC | MEMF_CLEAR)) {
  682.                if (id = AllocMem(sizeof (struct InfoData),
  683.                                  MEMF_PUBLIC | MEMF_CLEAR)) {
  684.                  if (mp = CreatePort(NULL, 0)) {
  685.                    sp->sp_Msg.mn_Node.ln_Name = (char *) &sp->sp_Pkt;
  686.                    sp->sp_Pkt.dp_Link         = &sp->sp_Msg;
  687.                    sp->sp_Pkt.dp_Port         = mp;
  688.                    sp->sp_Pkt.dp_Type         = ACTION_DISK_INFO;
  689.                    sp->sp_Pkt.dp_Arg1         = MKBADDR(id);
  690.        
  691.                    PutMsg(cfh->fh_Type, &sp->sp_Msg);
  692.                    (void) WaitPort(mp);
  693.                    (void) GetMsg(mp);
  694.        
  695.                    if (sp->sp_Pkt.dp_Res1)
  696.                      w = (struct Window *) id->id_VolumeNode;
  697.        
  698.                    DeletePort(mp);
  699.                  }
  700.                  FreeMem(id, sizeof (struct InfoData));
  701.                }
  702.                FreeMem(sp, sizeof (struct StandardPacket));
  703.              }
  704.            }
  705.        
  706.            return w;
  707.          }
  708.   
  709.      Notes:
  710.      * Accessing a console's window directly may interfere with operations
  711.        performed by the CON handler. Be careful!
  712.   
  713.      * To obtain the window pointer of a CLI's console, pass the
  714.        FileHandle returned by Open("*", MODE_OLDFILE) to the above
  715.        function.
  716.   
  717.      * The result of the above function may well be NULL, e.g. in case of
  718.        an AUX handler or if an AUTO CON handler is unable to open its
  719.        window.
  720.   
  721.      * Sending an ACTION_DISK_INFO packet to an AUTO CON handler (2.0+)
  722.        causes its window to lose its special AUTO properties (i.e. it can
  723.        no longer be closed at any time by clicking on its Close gadget),
  724.        as the window pointer returned in id_VolumeNode must remain valid
  725.        from now on.
  726.   
  727.      * All in all: Don't use this function. :-)
  728.   
  729.      For more information, please refer to pages 273, 276, 435, 463, 485,
  730.   and 629 in "The Amiga Guru Book" (see Manuals).
  731.   
  732.      Ralph Babel, rbabel@babylon.pfm-mainz.de
  733.   
  734.   4.10 What are pragmas?
  735.   ======================
  736.   
  737.      Pragmas are special compiler commmands which control certain
  738.   features of a C-compiler. Two problems arise when using pragmas:
  739.     1. Pragmas are compiler specific. You cannot expect that one compiler
  740.        will understand pragmas of another compiler, even if both run on
  741.        the Amiga.
  742.   
  743.     2. You are not guaranteed that a compiler ignores pragmas, that he
  744.        doesn't understand. Even more: It might not help, to use something
  745.        like this:
  746.                 #ifndef MY_COMPILER
  747.                 #pragma DoAnything
  748.                 #endif
  749.   
  750.   A workaround is to put pragmas in a special include file (BTW, the same
  751.   holds true for statements like #asm (Aztec-C) or #extern (C++) and
  752.   replace the above with
  753.            #ifndef MY_COMPILER
  754.            #include <mypragmas.h>
  755.            #endif
  756.   
  757.      But what do pragmas on the Amiga? The most common usage (not the
  758.   only, but most meant when talking about pragmas) is to tell the
  759.   compiler about how to call library functions: Simple C functions expect
  760.   their arguments on the stack, but library functions want their
  761.   arguments in special processor registers and additionally the `library
  762.   base' in register a6. Lets have a look at a pragma command of the
  763.   Aztec-Compiler.
  764.            #pragma amicall(SysBase,0xd2,FreeMem(a1,d0))
  765.   
  766.   This tells the compiler to put the first argument of FreeMem in register
  767.   a1, the second in register d0 and the value of the variable SysBase in
  768.   register a6. Maxons pragmas look the same, Dice pragmas and SAS pragmas
  769.   look a bit more complicated;
  770.            #pragma libcall SysBase FreeMem d2 0902
  771.   
  772.   Here d2 is (like 0xd2 above) the `library vector offset' (see below),
  773.   the digits 09 are codes for the argument register in reversed order
  774.   (Register codes are 0=d0, 1=d1, .., 8=a0, 9=a1, a=a2, ..), the
  775.   following 0 is the result's registerΣ(always d0))and the final digit 2
  776.   is the number of arguments.
  777.   
  778.      A command `FreeMem(fib,sizeof(*fib);' could produce the following
  779.   code, if the compiler has seen a pragma statement like above:
  780.            move.l  _fib,a1
  781.            move.l  260,d1        ; sizeof(struct FileInfoBlock)
  782.            move.l  _SysBase,a6
  783.            jsr     -0xd2(a6)       ; 0xd2 = _LVOFreeMem
  784.   
  785.   Calling FreeMem in that way is shorter and faster than pushing the
  786.   arguments on the stack, calling a function _FreeMem which would do just
  787.   the same like the above code by pulling the arguments from the stack.
  788.   
  789.      The best way to use pragmas is to include statements like the
  790.   following in your program:
  791.            /*  SAS/C, Dice and GNU-c (since version 2.6.1) make it    */
  792.            /*  very simple:                        */
  793.            #if defined(__SASC)  ||  defined(_DCC)  ||  defined(__GNUC__)
  794.              #include <proto/exec.h>
  795.            #else
  796.        
  797.              /*  Get the prototype for the function; note, that this    */
  798.              /*  is compiler independent.                */
  799.              #include <clib/exec_protos.h>
  800.        
  801.              /*  Get the pragma; compiler dependent, but most pragmas    */
  802.              /*  are in files with the same name.            */
  803.              #ifdef AZTEC_C
  804.                #include <pragmas/exec_lib.h>
  805.              #elif defined(__MAXON__)
  806.                #include <pragmas/exec_pragmas.h>
  807.              #endif
  808.        
  809.              /*  Declare the SysBase variable                */
  810.              extern struct ExecBase *SysBase;
  811.            #endif
  812.   
  813.   The above example can be compiled on all these compilers and produce the
  814.   best code. (Besides, the proto/*.h-files do nothing else than reading
  815.   clib/*_protos.h and pragmas/*_pragmas.h with #include and then declare
  816.   the SysBase variable.)
  817.   
  818.      A final question arises: How to get the pragmas? Most compilers have
  819.   them included. However, sometimes you want to produce pragmas for
  820.   yourself, for example if you are using new libraries or new versions
  821.   with additional functions. In that case you can produce them from the
  822.   so-called `FD' files which should be a part of the developer docs of
  823.   the library. (The NDU has a directory FD which contains FD files for
  824.   all libraries and devices of the OS. see Includes) Most compilers have
  825.   a utility with the name `fd2pragma' or similar included which can do
  826.   that for you. A freely distributable version which can produce pragmas
  827.   for Aztec, Dice, SAS and Maxon as well as LVO files for assembler and
  828.   stub routines for the tag versions is available on Aminet
  829.   (`dev/misc/fd2pragma2_0.lha' and on the Fish CDs.
  830.   
  831.      For pragmas under gcc see Inline Headers.
  832.   
  833.   4.11 My Compiler/Linker is complaining about missing symbol xxx.
  834.   ================================================================
  835.   
  836.      First be sure, that the function is really missing: For example
  837.   floating point functions are in a special link library and you need a
  838.   linker option like `-lm' to include it into your program. Another
  839.   possibility would be that you are using a library function and didn't
  840.   notice it. This might lead to a missing library base, `IntuitionBase'
  841.   for example. In that case just put something like
  842.            struct Library *IntuitionBase;
  843.   
  844.   somewhere in the global part of your program. (Don't forget to call
  845.   OpenLibrary() and CloseLibrary! :-)
  846.   
  847.      However, you could as well use a function which really isn't present
  848.   in your library at all. If you have, for example, an amiga.lib from 2.0
  849.   you would hardly find the locale functions or the pool memory
  850.   functions. (1) Best solution is to get the NDU (see Includes), but you
  851.   probably don't want to wait for it. In that case you have to find what
  852.   kind of function you are missing.
  853.      * Simple library functions (Examples: `exec/AllocPooled',
  854.        `locale/OpenCatalogA') can be called with pragmas. However, you
  855.        need informations on the name of the library base and where to put
  856.        the arguments. See Pragmas.
  857.   
  858.      * Tag functions are mostly just stub functions which call library
  859.        functions. If you have, for example, `dos/AllocDosObject' which
  860.        expects a constant and a pointer to an array of tags, you have the
  861.        varargs version `AllocDosObjectTags' which expects tags on the
  862.        stack as well! Just create the following function:
  863.                 #include <clib/dos_protos.h>
  864.                 #include <pragmas/dos_pragmas.h>    /*  Probably wrong name */
  865.             
  866.                 void *AllocDosObjectTags(ULONG objtype, Tag tag1, ...)
  867.                 { return(AllocDosObject(objtype, (struct TagItem *) &tag1);
  868.                 }
  869.   
  870.      * Some functions still remain: Amiga.lib has some functions which
  871.        are really doing valuable things and not just call a library: The
  872.        BOOPSI functions (`DoMethod', `DoSuperMethod') the memory pool
  873.        functions (`LibAllocPooled', `LibCreatePool', which are
  874.        replacements of 3.0 functions). The only way to replace these is
  875.        to get equivalents. The AmigaFAQ archive contains some of them
  876.        (DoMethod, DoSuperMethod and HookEntry) in the `programmer'
  877.        directory as well as the most common pragma files and some
  878.        examples of varargs functions. See Amiga-FAQ Archive.
  879.   
  880.      ---------- Footnotes ----------
  881.   
  882.      (1)  This problem arises most frequently for owners of Aztec which
  883.   is no longer supported and owners of Dice, which has sometimes rather
  884.   incomplete libraries. I own both ...
  885.   
  886.   4.12 Where do I find the function xxx?
  887.   ======================================
  888.   
  889.      If you are not sure about the name of the appropriate function for a
  890.   certain job or in which library to find it, you can search in these
  891.   places:
  892.      * In the Autodocs for each library you find at the very beginning a
  893.        contents table listing all functions available in this library.
  894.        They are sorted alphabetically, just like in the rest of the
  895.        Autodocs.  In the body part of the Autodocs you find complete
  896.        explanations and specifications for each library function. See
  897.        Includes.
  898.   
  899.      * The .FD files also offer a very compact overview over all functions
  900.        of the diverse libraries, complete with a short information about
  901.        the function arguments. If you already know roughly what you
  902.        search for and e.g. only need the precise order of the arguments,
  903.        you can find all needed information here. See Pragmas.
  904.   
  905.      Dr. Peter Kittel, peterk@cbmger.de.so.commodore.com
  906.   
  907.   4.13 The GNU C compiler: general information and installation
  908.   =============================================================
  909.   
  910.      This chapter contains general and installation information about the
  911.   amiga-port of the GNU C compiler gcc.
  912.   
  913.   4.13.1 Current Version
  914.   ----------------------
  915.   
  916.      Gcc current version is now 2.6.0 and 2.6.1 is in work.  It does
  917.   include a new version of ixemul.library, v40.3, but users are urged to
  918.   get ixemul404.lha on Aminet site or my own FTP site, due to errors for
  919.   68000 systems. A new library, libnix, avoid using ixemul.library.
  920.   2.6.1 will include protos, like SAS-C, making SASC ports to GCC easier.
  921.   A new assembler, gas-2.5 is included, a package called q_anote enables
  922.   output of mixing C/Asm code for debugging purposes.  Work is in
  923.   progress to implement stack growing facility, thus avoiding setting
  924.   stack before launching gcc.
  925.   
  926.   4.13.2 Requirements
  927.   -------------------
  928.   
  929.      Any Amiga (ranging from A1000 upto A4000/40) will run amigados-gnu
  930.   utilities. A minimum of 4MB memory is needed in order to compile
  931.   small/medium projects. More memory will be needed for large projects,
  932.   such as recompiling gcc itself, or programming C++. Gigamem and VMM do
  933.   work with GCC so *maybe* less memory will work. But in this case, an
  934.   MMU equipped Amiga (A3000,A4000/40) is necessary.  See 68EC0xx.
  935.   
  936.      A full installation, including C++/ObjC related files, inline
  937.   headers, cbm-headers, (see Includes) roughly requires about 20 MB of HD
  938.   space.
  939.   
  940.      Support for 1.2/1.3 is dropped. If you have 1.2/1.3, get a better
  941.   Kickstart version. Gcc works under KS 1.2/1.3, but the full
  942.   functionality is only available under KS 2.x+. A fast CPU (eg.
  943.   68030@25MHz or better) is also of help.
  944.   
  945.   4.13.3 Authors
  946.   --------------
  947.   
  948.      Gcc and related GNU-software has been ported to the Amiga by the
  949.   following folks: See How to get help.
  950.            Gcc v2.2.2 port:   Markus Wild
  951.            Gcc v2.3.3 port:   Markus Wild
  952.            Gcc v2.4.5 port:   Philippe Brand, Lars Hecking, Fred Fish
  953.            Gcc v2.5.0 and up: Philippe Brand, Fred Fish, Leonard Norrgard
  954.        
  955.            Ixemul.library:    Markus Wild, Leonard Norrgard, R. Luebbert
  956.            Libnix:           Matthias Fleischer, Gunther Nikl
  957.                Gerlib:            Gerhard Mueller
  958.   
  959.   4.13.4 Sources for Gcc
  960.   ----------------------
  961.   
  962.      All GCC sources & binaries are available on:
  963.   
  964.     1. Aminet sites (wuarchive.wustl.edu and mirrors such as ftp.luth.se)
  965.        in /pub/aminet/dev/gcc
  966.   
  967.     2. Ramses The Amiga Flying BBS:
  968.                 +33-1-60037015  HST Dual v32 terbo 4800-21600
  969.                     +33-1-60037713  SupraFax v32bis    4800-14400
  970.                     +33-1-60037716  Tornado v22bis     1200-2400
  971.        in Topic `Development', Area `Gcc' (are 156).
  972.   
  973.      GNU source code is available on:
  974.   
  975.     1. the same FTP site you've taken the binary distribution from
  976.   
  977.     2. gnu.prep.ai.mit.edu (18.71.0.38) in `/pub/gnu'
  978.   
  979.     3. Ramses The Amiga Flying BBS in Topic
  980.        `AmigaUnix/Unix/Linux/NetBSD', Area `Gnu Source Code'
  981.   
  982.      These archives should contain everything necessary to get you going,
  983.   they don't include sources for ixemul.library, which are available on
  984.   Aminet sites in `/pub/aminet/dev/gcc/ixemsrc3947.tar.gz' (as of this
  985.   writing, work is in  progress for the v40 version of ixemul.library,
  986.   sources will be available on an Aminet site near you).
  987.   
  988.      As stated by Richard Stallman of the FSF:
  989.   
  990.      "The GPL says that any distribution of binaries must contain either
  991.   the source code or a written offer to supply source code (see the GPL
  992.   for details of what is required)."
  993.   
  994.   4.13.5 Inline Headers
  995.   ---------------------
  996.   
  997.      The inline headers for gcc can be created from the original CBM fd
  998.   files.  See Includes. See Pragmas. They can be created as follows:
  999.   
  1000.        CLI> Assign INCLUDE: GCC:os-include
  1001.        CLI> Assign FD: INCLUDE:fd
  1002.        CLI> Makedir INCLUDE:inline
  1003.        CLI> cd USR:bin/geninline
  1004.        CLI> gen31
  1005.   
  1006.      This will create all inline-headers in `GCC:os-include/inline'.  If
  1007.   you have 2.0 headers, use gen20 instead, if you have 3.0, use gen30.
  1008.   OS3.1 (rev 40.13) inline headers are included with the current version
  1009.   of gcc. See Current Version.
  1010.   
  1011.      NOTE: perl scripts do not handle correctly AmigaDOS include files,
  1012.   which seems to mean they are somewhat broken. This needs some voluntary
  1013.   work ...
  1014.   
  1015.      There is also another way of generating inline headers, using
  1016.   fd2inline program:
  1017.   
  1018.        CLI> fd2inline <fd_file> <proto_file>
  1019.   
  1020.   4.13.6 Amiga Libraries
  1021.   ----------------------
  1022.   
  1023.      Starting from this release an AmigaDOS compliant library is provided,
  1024.   thanks to libnix authors (Matthias Fleischer and Gunther Nikl).
  1025.   
  1026.      Anyway if you want to rebuild one, there are two methods:
  1027.   
  1028.      1) Using hunk2gcc; the AmigaDOS object converter made by Markus
  1029.   Wild. To achieve this, simply grab a copy of latest amiga.lib (from
  1030.   Commodore Development Kit, see Includes) and make a new directory where
  1031.   you want your converted object files to go, cd into it, and enter
  1032.   
  1033.            hunk2gcc amiga.lib [..further libs if you like..]
  1034.   
  1035.      This generates an a.out object file for every program unit present
  1036.   in the hunk file (in this case, from amiga.lib).
  1037.   
  1038.      As the final step convert all those files into an a.out style
  1039.   library by issuing:
  1040.   
  1041.            ar qc libamiga.a obj.*
  1042.            ranlib libamiga.a
  1043.   
  1044.      The ranlib run builds a symbol table in the archive, and makes
  1045.   accesses to the library much faster.
  1046.   
  1047.      2) Creating a libamiga.a library with libnix is fairly easy, but
  1048.   takes some time. Just uncompress sources.lha from libnix distribution
  1049.   and run a `make libamiga.a'.
  1050.   
  1051.      *Note:* As long as you make no AmigaDOS specific calls, you can
  1052.   create a dummy library using:
  1053.   
  1054.          cat "int dummy;" >dummy.c
  1055.          gcc -c dummy.c
  1056.          ar crv libamiga.a dummy.o
  1057.          mv libamiga.a gcc:lib
  1058.   
  1059.   4.13.7 Installation
  1060.   -------------------
  1061.   
  1062.     1. If this is your first installation of GCC:
  1063.   
  1064.        Do the following:
  1065.   
  1066.             cd place_with_lot_of_space      ; EDIT! specify one
  1067.             makedir gnu
  1068.             lha x gcc260-base.lha           ; first part, you need it
  1069.   
  1070.        Now you have to append `gnu/s/user-startup' to your
  1071.        `s:user-startup' (replace Devel:GNU by your own gnu path).
  1072.   
  1073.        Continue:
  1074.   
  1075.             execute gnu/s/user-startup      ; makes important assigns
  1076.             copy gnu/envarc/#? ENVARC:
  1077.   
  1078.        *Edit* the following lines!  If you have a 68000 or 68010 Amiga,
  1079.        remove the "-020" from the following lines wherever it appears!
  1080.   
  1081.             lha x gcc260-c-020.lha      ; C-compiler part; you need it
  1082.             lha x gcc260-doc.lha        ; only if you want Gcc documentation
  1083.             lha x gcc260-c++-020.lha    ; only if you want C++
  1084.             lha x gcc260-objc-020.lha   ; only if you want Objective-C
  1085.             lha x gcc260-utils.lha      ; only if you want additional utilities
  1086.                                         ; (recommended for Unix compatibility)
  1087.             lha x gcc260-utilsdoc.lha   ; if you want all utilities documentation
  1088.   
  1089.        You must restore links between some programs by running the script
  1090.        `restorelinks':
  1091.   
  1092.             sh /gnu/s/restorelinks      ; EDIT! Append a " copy" to this line
  1093.                                         ; if you don't want to use makelink
  1094.                                         ; but rather copy file
  1095.   
  1096.        Last part:
  1097.   
  1098.             lha x gcc260-diffs.lha      ; if you want to rebuild all distribution
  1099.             lha x gcc260-texi.lha       ; if you want to build Postscript doc files
  1100.   
  1101.        Now skip to next paragraph and happy compiling!
  1102.   
  1103.     2. If you "upgrade" your gcc environment from v2.5.x, just unarchive
  1104.        first 2 archives as it would normally include all what you need
  1105.        (thus gcc260-base and gcc260-c). Make sure you delete your
  1106.        previous ixemul.library wherever it is (usually LIBS:).
  1107.   
  1108.   
  1109.      *Note*:  new version of ixemul.library is provided, make sure you
  1110.   don't have another copy somewhere which may conflict with gcc.
  1111.   
  1112.   4.13.8 Compiling
  1113.   ----------------
  1114.   
  1115.      What about a nice Hello World ?
  1116.   
  1117.        #include <stdio.h>
  1118.        
  1119.        main()
  1120.        {
  1121.          printf("Hello World!\n");
  1122.        }
  1123.   
  1124.      This was pretty simple ;-) Now we have to compile it.  There's a lot
  1125.   of options in gcc but simplest way to compile this would be:
  1126.   
  1127.        CLI> gcc -o hello hello.c
  1128.   
  1129.      Simple ?
  1130.   
  1131.      Here's more options.
  1132.   
  1133.      Target processor for Motorola family: You can compile plain 68000
  1134.   code, 68020, 68030, 68040, 68881 (have a look at GCC documentation,
  1135.   either in info or AmigaGuide format, chapter `Invoking Gcc/SubModel
  1136.   Options/M680X0 Options for Motorola specific compilation flags').
  1137.   
  1138.        CLI> gcc -m68020 -m68881 -o hello hello.c
  1139.   
  1140.      This will compile your programs using 68020 code and direct calls to
  1141.   math-processor, and will link with accelerated libraries, located in
  1142.   `GCC:lib/lib020'.
  1143.   
  1144.      Optimization: Either you don't want optimization, or you can provide
  1145.   `-O', which will optimize your code, or if you really want top
  1146.   optimization, use `-O2' flag (for more discussion about optimization,
  1147.   read info or AmigaGuide doc chapter Invoking Gcc/Optimize Options).
  1148.   There's now even a `-O3' optimization option, which will go even
  1149.   further.
  1150.   
  1151.        CLI> gcc -O2 -o hello hello.c
  1152.   
  1153.      You'll never have a "Hello World" program running so fast ;-)
  1154.   
  1155.      Code generation: Perhaps you want to generate resident programs.
  1156.   Flag is -resident, at compile and link stage.
  1157.   
  1158.        CLI> gcc -resident -o hello hello.c
  1159.   
  1160.      Of course you can mix all options, resulting in:
  1161.   
  1162.        CLI> gcc -O2 -m68020 -m68881 -resident -o hello hello.c
  1163.   
  1164.      This will make a 68020+68881 executable highly optimized and
  1165.   resident.
  1166.   
  1167.      IMPORTANT: If you only use AmigaDOS functions or you don't want to
  1168.   use ixemul for philosophical reasons, you can get rid of ixemul.library
  1169.   with:
  1170.   
  1171.        CLI> gcc -noixemul -o foobar foobar.c
  1172.   
  1173.      provided you have libnix distribution (included with 2.6.0
  1174.   distribution).
  1175.   
  1176.   4.13.9 How to get help
  1177.   ----------------------
  1178.   
  1179.      The current amiga-gcc-port maintainer is available:
  1180.   
  1181.            Philippe BRAND
  1182.            Fidonet: Ramses The Amiga Flying BBS 2:320/104.21
  1183.            Email:   phb@colombo.telesys-innov.fr (ONLY for personnal email).
  1184.            Ftp:     colombo.telesys-innov.fr:/pub/amigados-gnu
  1185.                     or /pub/incoming/uploads for uploads.
  1186.   
  1187.      There's also an amiga-gcc mailing list running in Finland.  See
  1188.   Mailing lists.  Philippe Brand will forward all questions to that list,
  1189.   but you'd be better off using it directly ;)
  1190.   
  1191.